package node;

public class ParamNode implements Node {

	private int idx;
	
	public ParamNode(int idx) {
		this.idx = idx;
	}
	
	public int evaluate(int[] param) {
		return param[idx];
	}
	
	public void display(int indent) {
		String in = new String();
		for(int i = 0; i < indent; i++)
			in = in + " ";
		
		System.out.println(in + "p" + idx);
	}
	
	public Node copyNode() {
		return new ParamNode(idx);
	}
}
